package com.moran.tools;

import cn.hutool.json.JSONUtil;
import com.moran.service.UserService;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class UserTools {

    @Autowired
    private UserService userService;

    @Tool(description = "根据用户输入的ID查询用户详细信息")
    public String getUserInfo(String id) {
        Map<String, Object> map = userService.getUserInfo(id);
        return JSONUtil.toJsonStr(map);
    }

}
